//
//  CardCollectionViewCell.m
//  Base_App
//
//  Created by Yutian Duan on 2019/5/28.
//  Copyright © 2019年 Wanwin. All rights reserved.
//

#import "CardCollectionViewCell.h"

@implementation CardCollectionViewCell

- (instancetype)initWithFrame:(CGRect)frame {
  if (self = [super initWithFrame:frame]) {
    [self addSubviews];
  }
  return self;
}

- (void)addSubviews {
  
  
  //!
  _typeImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 38, 15)];
  _typeImageView.image = [UIImage imageNamed:@"Home_new"];
  _typeImageView.contentMode = UIViewContentModeScaleAspectFit;
  [self.contentView addSubview:_typeImageView];

  //!
  _typeLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 20, 100, 30)];
  _typeLabel.textAlignment = NSTextAlignmentLeft;
  _typeLabel.textColor = [UIColor blackColor];
  _typeLabel.font = [UIFont fontWithName:@"Helvetica-Bold" size:16.0f];
  _typeLabel.text = YTLocalizedString(@"汽车保险报价");
  [self.contentView addSubview:_typeLabel];
  
  //!
  UIView *bgView = [[UIView alloc] initWithFrame:CGRectMake(0, 50, self.bounds.size.width, self.bounds.size.height - 50)];
  bgView.layer.cornerRadius = 8;
  bgView.layer.masksToBounds = YES;
  bgView.backgroundColor = [UIColor whiteColor];
  [self.contentView addSubview:bgView];
  
  
  self.imageIV = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, bgView.yt_width, bgView.yt_width * IMAGEPRO)];
  [bgView addSubview:self.imageIV];
  
  self.titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(20, self.imageIV.yt_bottom, bgView.yt_width - 40, 30)];
  self.titleLabel.textAlignment = NSTextAlignmentLeft;
  self.titleLabel.textColor = [UIColor blackColor];
  self.titleLabel.font = [UIFont fontWithName:@"Helvetica-Bold" size:16.0f];
  self.titleLabel.text = YTLocalizedString(@"享全新投保计划");
  [bgView addSubview:self.titleLabel];
  
  //!
  self.noteImageView = [[UIImageView alloc] initWithFrame:CGRectMake(20, self.titleLabel.yt_bottom, 40, 20)];
  self.noteImageView.image = [UIImage imageNamed:@"Home_timeLimit"];
  [bgView addSubview:self.noteImageView];

  self.noteLabel = [[UILabel alloc] initWithFrame:CGRectMake(self.noteImageView.yt_right + 10, self.noteImageView.yt_top, bgView.yt_width - self.noteImageView.yt_right - 20, self.noteImageView.yt_height)];
  self.noteLabel.font = [UIFont systemFontOfSize:14];
  self.noteLabel.text = [NSString stringWithFormat:@"%@！",YTLocalizedString(@"投保e客户特享受全城至低价格")];
  self.noteLabel.textAlignment = NSTextAlignmentLeft;
  self.noteLabel.textColor = DEF_GRAY;
  [bgView addSubview:self.noteLabel];
  
}


@end
